package Work3;

public class fizz extends Thread{
	int num;
	public fizz(int num){
		this.num=num;
	}
	@Override
	public void run() {
		synchronized (FizzBuzzDemo.lock) {
				if(num%3==0){
					if(FizzBuzzDemo.weakup){
						try {
							FizzBuzzDemo.lock.wait();
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
					System.out.print("fizz ");
					FizzBuzzDemo.weakup=true;
				
				}
			
		}
		
	}
}
